package cn.wen.yaling.xo.dao;

import cn.wen.yaling.commons.entity.QuestionsEntity;
import cn.wen.yaling.commons.vo.QuestionListVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 
 * 
 * @author FY
 * @email 932043654@qq.com
 * @date 2022-08-13 02:07:37
 */
@Mapper
@Component
public interface QuestionsDao extends BaseMapper<QuestionsEntity> {

    /**
     * 获取当前全部激活的问答基本信息
     * @return
     */
    List<QuestionListVO> getAllIsActiveQuestionList();

    /**
     * 插入到关系表中
     * @param questionId
     * @param typeId
     */
    void insertQuestionTypeRelation(@Param("questionId") Integer questionId, @Param("typeId") Integer typeId);

    /**
     * 批量修改问答的状态为删除状态
     * @param questionIds
     * @param status
     * @return
     */
    boolean updateBatchQuestion(@Param("questionIds") Integer[] questionIds, @Param("status")Integer status);

    /**
     * 获取问答分类
     * @param questionId
     * @return
     */
    Integer getQuestionTypeId(@Param("questionId") Integer questionId);
}
